package com.take.state;

/**
 * 待支付状态：有支付和取消两种事件
 */
public class WaitPaymentState implements OrderState {

    @Override
    public OrderStateEnum orderStateType() {
        return OrderStateEnum.WAIT_PAYMENT;
    }

    @Override
    public void pay(OrderStateMachine stateMachine) {
        stateMachine.setCurrentState(new WaitDeliverState());
    }

    @Override
    public void cancel(OrderStateMachine stateMachine) {
        stateMachine.setCurrentState(new CancelState());
    }
}
